package com.zxm.dubbodemo.consumer.controller;

import com.zxm.dubbodemo.api.DemoServiceFacade;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {

    @Reference(version = "${demo.service.version}",
            application = "${dubbo.application.id}",
            registry = "${dubbo.registry.id}")
    private DemoServiceFacade demoService;

    @GetMapping("hello/{name}")
    public String sayHello(@PathVariable String name){
        return demoService.sayHello(name);
    }
}
